<template>
    <el-dialog :title="tip" :visible.sync="dialogFormVisible">
        <el-form>
            <el-form-item label="文件上传" :label-width="formLabelWidth">
                <upload_xls :close_file="dialogFormVisible" :url="'http://localhost:8080/stu/import'"></upload_xls>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
        </div>
    </el-dialog>
</template>

<script>
    import upload_xls from '../../homework/subcomponents/UploadXls.vue'
    export default {
        name: "PushStudentList",
        created() {

        },
        data() {
            return {
                formLabelWidth: '120px',
                dialogFormVisible: false,
                job: [],
                selectedJobIndex: 0
            }
        },
        methods: {
            postFlagToParent() {
                this.$emit("getValueFromStuList", false);
            }
        },
        watch: {
            flag: function () {
                this.dialogFormVisible = this.flag;
            },
            dialogFormVisible: function () {
                if (!this.dialogFormVisible) {
                    this.postFlagToParent()
                }
            }
        },
        props: ['flag', 'tip'],
        components: {
            upload_xls,
        }
    }
</script>

<style lang="scss" scoped>
    .el-form {
        .el-form-item {
            .el-select {
                width: 250px;
            }

            .el-input {
                width: 350px;
            }
        }
    }
</style>
